docs(social): credit pricing (5 + posts) + auth on scrape endpoints#259
Conversation
Both scrape endpoints now cost 5 credits plus 1 credit per requested post (per profile on the bulk endpoint). Adds the 402 insufficient-credits response (mirrors the research family's schema) to both, and documents auth (security + 401/403) on POST /api/artist/socials/scrape, which gains authentication as part of the same change. Contract for the credit-gate item on recoupable/chat#1836; api PR follows. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 27 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
…-endpoint Per review direction: no sibling endpoint states its credit cost in its reference description, so the price moves to credits.mdx's What's-billed table (social scrape leaves the free row). The OpenAPI diff keeps only what the endpoints now actually emit: 402 insufficient-credits responses (research-family precedent) and auth (security + 401/403) on the bulk endpoint. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
1 issue found across 3 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="credits.mdx">
<violation number="1" location="credits.mdx:17">
P3: The "Cost per endpoint" table at the bottom of the page omits the two social scrape endpoints now that they're billed. All other billed families (research variants, image generate, chat) have entries there — social scrape should too for consistency.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| @@ -14,7 +14,8 @@ Some Recoup endpoints are billed in **credits** — primarily endpoints that hit | |||
| | **Research** ([`/api/research/*`](/api-reference/research/search)) | Yes | Each successful call deducts credits. Costs vary by endpoint and parameters (e.g. [`enrich`](/api-reference/research/enrich) charges by processor tier; [`extract`](/api-reference/research/extract) charges by URL count). | | |||
There was a problem hiding this comment.
P3: The "Cost per endpoint" table at the bottom of the page omits the two social scrape endpoints now that they're billed. All other billed families (research variants, image generate, chat) have entries there — social scrape should too for consistency.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At credits.mdx, line 17:
<comment>The "Cost per endpoint" table at the bottom of the page omits the two social scrape endpoints now that they're billed. All other billed families (research variants, image generate, chat) have entries there — social scrape should too for consistency.</comment>
<file context>
@@ -14,7 +14,8 @@ Some Recoup endpoints are billed in **credits** — primarily endpoints that hit
| **Content generation** ([`/api/image/generate`](/api-reference/image/generation)) | Yes | Image generation is priced per call. |
| **AI Chat — streaming** ([`POST /api/chat`](/api-reference/chat/workflow)) | Yes | Variable cost based on model token usage, with a per-request minimum. |
-| **Everything else** | Free at the API layer | [Artist CRUD](/api-reference/artists/list), [sandboxes](/api-reference/sandboxes/list), [sessions](/api-reference/sessions/get), [scheduled tasks](/api-reference/tasks/get), [social integrations](/api-reference/social/scrape), [account/org management](/api-reference/accounts/id), [agent signup](/api-reference/agents/signup), [Spotify proxies](/api-reference/spotify/search), etc. Subscription gating may still apply. |
+| **Social scrape** ([`/api/socials/{id}/scrape`](/api-reference/social/scrape), [`/api/artist/socials/scrape`](/api-reference/artist/socials-scrape)) | Yes | 5 credits, plus 1 credit per post requested via `posts` — per social profile scraped. |
+| **Everything else** | Free at the API layer | [Artist CRUD](/api-reference/artists/list), [sandboxes](/api-reference/sandboxes/list), [sessions](/api-reference/sessions/get), [scheduled tasks](/api-reference/tasks/get), [account/org management](/api-reference/accounts/id), [agent signup](/api-reference/agents/signup), [Spotify proxies](/api-reference/spotify/search), etc. Subscription gating may still apply. |
</file context>
…744) Charges 5 credits plus 1 credit per requested post for each social profile scraped, priced from measured Apify costs (recoupable/chat#1836 cost research: worst case is YouTube at ~$0.003 × 2×posts items; 5+posts at 1 credit = $0.01 keeps ≥1.75x margin at posts=100). - getSocialScrapeCreditCost: 5 + (posts ?? 0) - ensureSocialScrapeCredits / deductSocialScrapeCredits: mirror the research family's gate (ensureCreditsOrShortCircuit → 402 with checkoutUrl) and deduct-on-success (recordCreditDeduction, never throws) - POST /api/socials/{id}/scrape: validator gates after auth+access; handler deducts only when the Apify run started (no charge on unsupported platform or scrape-start failure) - POST /api/artist/socials/scrape: gains auth (validateAuthContext) + artist access check (checkAccountArtistAccess) — it previously had none; gates on (5+posts) × linked profiles, deducts per profile whose scrape actually started; [] with no charge when the artist has no socials Contract: recoupable/docs#259. Closes the credit-gate item on recoupable/chat#1836. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Summary
Contract PR for the credit-gate item on recoupable/chat#1836 (pricing per the cost research). Merge before the api PR.
posts" (bulk: per social profile scraped).ResearchInsufficientCreditsResponse(matchesbuildInsufficientCreditsResponseexactly:error/remaining_credits/required_credits/checkoutUrl/declineReason?).POST /api/artist/socials/scrape: addssecurity(apiKeyAuth/bearerAuth) + 401/403 responses — the endpoint gains auth in the api PR (it currently has none, flagged in the credits audit).Verification
Both OpenAPI files re-parse; diff is additive.
🤖 Generated with Claude Code
Summary by cubic
Moved social scrape pricing to
credits.mdx(5 credits + 1 perpostsper profile) and documented credit-gating and auth. Both scrape endpoints now include 402 insufficient-credits responses;POST /api/artist/socials/scrapeadds API-key/Bearer auth with 401/403.checkoutUrlto guide top-ups.POST /api/artist/socials/scrape, include API key or Bearer token and handle 401/403.Written for commit 9b57882. Summary will update on new commits.